//
// Created by ZYZ on 2020/6/9.
//
#include <stdio.h>
#include <string.h>

void test_printf(){
    //多个字符串只能输出一个
//  printf("字符串一","字符串二","字符串三");    //"字符串一"

    //测试带颜色输出
//  printf("\033[31mThis text is red \033[0mThis text has default color\n");
//  printf("\033[31;43mThis text is red with yellow background \033[0mThis text has default color\n");

    char str[5];
//    int ret = snprintf(str, 3, "%s", "abcdefg");
    memset(str,0,sizeof(str)/sizeof(char));
    int ret = snprintf(str, 3, "%c", 'x');
//    printf("%d\n",ret);
    printf("%s",str);
}
